notebook: Don't unparent tab label for drag
authorBenjamin Otte <otte@redhat.com>
Sat, 9 Jan 2016 13:25:26 +0000 (14:25 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 11 Jan 2016 16:06:46 +0000 (17:06 +0100)
When a tab drag starts, we need to move the tab label into the drag
window via gtk_widget_set_parent_window().
If we don't unparent, but just unrealize the widget, we don't lose the
cssnode position.

gtk/gtknotebook.c

index 04455f6d78823ba776a2fa04e94b702b5a4709f2..426281f24ce5e7a583bb74366dd4a2b5b142646b 100644 (file)
@@ -2977,9 +2977,10 @@ show_drag_window (GtkNotebook        *notebook,
     }
 
   g_object_ref (page->tab_label);
-  gtk_widget_unparent (page->tab_label);
+  gtk_widget_set_child_visible (page->tab_label, FALSE);
+  gtk_widget_unrealize (page->tab_label);
   gtk_widget_set_parent_window (page->tab_label, priv->drag_window);
-  gtk_widget_set_parent (page->tab_label, widget);
+  gtk_widget_set_child_visible (page->tab_label, TRUE);
   g_object_unref (page->tab_label);
 
   /* the grab will dissapear when the window is hidden */